import Vue from 'vue'
import auth from '../auth'
import axios from 'axios'
import consts from '../consts'
import qs from 'qs'

export default {
  install (Vue) {
    Vue.prototype.$auth = auth
    Vue.prototype.$http = axios,
    Vue.prototype.$consts = consts
    Vue.prototype.$qs = qs
    }
  }

  Vue.filter('handleTime', value => {
    return value.substring(5,10)
  })
  
  Vue.filter("twoFloat", number => {
    if (!number) return number
    var number1 = number.toString().split('.')
    if (number1.length == 1) {
      number = number.toString() + '.00'
      return number
    }
    if (number1.length > 1) {
      if (number1[1].length < 2) {
        number = number.toString() + '0'
      }
      if (number1[1].length > 2) {
        number = number1[0] + '.' + number1[1].substring(2, 0)
      }
      return number
    }
  })